package space.enemy;

import org.anddev.andengine.engine.handler.physics.PhysicsHandler;
import org.anddev.andengine.entity.IEntity;

public class PhysicsHandlerParabolic extends PhysicsHandler{

	
	public PhysicsHandlerParabolic(IEntity pEntity) {
		super(pEntity);
	}
	@Override
	protected void onUpdate(final float pSecondsElapsed, final IEntity pEntity) {
		
		if(super.isEnabled()) {
			/* Apply linear acceleration. */
			System.out.println("x:"+pEntity.getX() *  pSecondsElapsed+"y:"+(float)Math.pow(pEntity.getX()*pSecondsElapsed,2));
			pEntity.setPosition(pEntity.getX() +  pSecondsElapsed*5.5f,  pEntity.getY()+(float)Math.pow(pSecondsElapsed*5.5f,2));
			System.out.println("x1:"+pEntity.getX() *  pSecondsElapsed*0.5+"y1:"+(float)Math.pow(pEntity.getX()*pSecondsElapsed*0.5,2));
		}
	}

}
